package example.simple_mindmap.common.designs.chain;

/**
 * @Program: 8.mindmap
 * @Author: 海里的鱼
 * @Create: 2024-09-08 19:41
 * @Name: TODO
 * @Desc: 责任链处理者
 */
public  class ChainNode<T extends IChainHandlerStrategy> {
    //处理者类型，用于从Bean容器里获取处理者对象
    private Class<T> handlerClass;
    //处理者对象，直接new对象也是可以的
    private T handler;
    //处理者名称，介绍一下处理的用途什么什么的，作为一个标识
    private String handlerName;

    public ChainNode(Class<T> handlerClass, T handler,String handlerName) {
        this.handlerClass = handlerClass;
        this.handler = handler;
        this.handlerName = handlerName;
    }

    public Class<T> getHandlerClass() {
        return handlerClass;
    }

    public void setHandlerClass(Class<T> handlerClass) {
        this.handlerClass = handlerClass;
    }

    public T getHandler() {
        return handler;
    }

    public void setHandler(T handler) {
        this.handler = handler;
    }
}
